╔══════════════════════════════════════════════════════════════════╗
║     PTERODACTYL PANEL & WINGS INSTALLATION GUIDE (ASCII)         ║
║              Complete Step-by-Step Walkthrough                   ║
╚══════════════════════════════════════════════════════════════════╝

┌─────────────────────────────────────────────────────────────────┐
│ STEP 1: START THE INSTALLATION                                  │
└─────────────────────────────────────────────────────────────────┘

  Run this command as root:
  
  # bash <(curl -s https://pterodactyl-installer.se)


┌─────────────────────────────────────────────────────────────────┐
│ STEP 2: SELECT INSTALLATION TYPE                                │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ Which version of Pterodactyl do you want to install?        │
  │ 1) Panel                                                    │
  │ 2) Wings                                                    │
  │ 3) Both (Panel & Wings)                                     │
  └─────────────────────────────────────────────────────────────┘
  
  >>> SELECT: 3 (BOTH)
  
  > Type "3" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 3: CONFIRM INSTALLATION                                    │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Are you sure you want to continue? (y/N):                 │
  └─────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES)
  
  > Type "y" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 4: DATABASE CONFIGURATION                                  │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Do you want to automatically configure the database?      │
  │   (y/N):                                                    │
  └─────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES)
  
  > Type "y" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 5: DATABASE USERNAME & PASSWORD                            │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Database host username (pterodactyluser):                 │
  └─────────────────────────────────────────────────────────────┘
  
  >>> LEAVE BLANK: Press ENTER (uses default)
  
  ┌─────────────────────────────────────────────────────────────────┐
  │ * Database host password:                                       │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> IMPORTANT! Type a strong password (write it down!)
  > Example: MyStr0ngP@ssw0rd!2026
  > Press ENTER after typing


┌─────────────────────────────────────────────────────────────────┐
│ STEP 6: MYSQL EXTERNAL ACCESS                                   │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Do you want to configure MySQL to be accessed             │
  │   externally? (y/N):                                        │
  └─────────────────────────────────────────────────────────────┘
  
  >>> SELECT: n (NO)
  
  > Type "n" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 7: EMAIL CONFIGURATION                                     │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Enter your email address for the panel:                   │
  └─────────────────────────────────────────────────────────────┘
  
  >>> Type your email: admin@example.com
  > Press ENTER

  ┌─────────────────────────────────────────────────────────────┐
  │ * Enter your company/panel name:                            │
  └─────────────────────────────────────────────────────────────┘
  
  >>> Type a name: My Game Panel
  > Or leave blank: Press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 8: CREATE ADMIN USER                                       │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ * Would you like to create an admin user? (y/N):            │
  └─────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES)
  
  > Type "y" and press ENTER

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Enter your email address:                                     │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> Type your admin email: admin@example.com

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Enter your username:                                          │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> Type your username: admin

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Enter your first name:                                        │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> Type your first name: John

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Enter your last name:                                         │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> Type your last name: Doe

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Enter your password:                                          │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> IMPORTANT! Type a strong password (write it down!)
  > Example: Admin@2026#Secure!
  > Press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 9: SSL CONFIGURATION (PANEL)                               │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Do you want to use Let's Encrypt SSL? (y/N):                  │
  └─────────────────────────────────────────────────────────────────┘
  
  ╔══════════════════════════════════════════════════════════════════╗
  ║  IF YOU HAVE A DOMAIN NAME:                                      ║
  ║    SELECT: y (YES)                                               ║
  ║    Then enter your domain: panel.example.com                     ║
  ║                                                                  ║
  ║  IF YOU ONLY HAVE AN IP ADDRESS (NO DOMAIN):                     ║
  ║    SELECT: n (NO)                                                ║
  ║    The panel will use HTTP (port 80)                             ║
  ╚══════════════════════════════════════════════════════════════════╝
  
  >>> Choose based on your setup
  > Type "y" or "n" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 10: WINGS CONFIGURATION (UFW FIREWALL)                     │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Do you want to automatically configure UFW (firewall)?        │
  │   (y/N):                                                        │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES) - Recommended!
  
  > Type "y" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 11: DATABASE USER FOR WINGS                                │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Do you want to configure a user for database hosts?           │
  │   (y/N):                                                        │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES)
  
  > Type "y" and press ENTER

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Database host username (pterodactyluser):                     │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> LEAVE BLANK: Press ENTER

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Database host password:                                       │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> Type a password (write it down!)
  > Example: WingsDB@2026#Strong!
  > Press ENTER

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Do you want to configure MySQL to be accessed externally?     │
  │   (y/N):                                                        │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> SELECT: n (NO)
  
  > Type "n" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 12: SSL FOR WINGS                                          │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Do you want to automatically configure HTTPS using            │
  │   Let's Encrypt? (y/N):                                         │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> SELECT: n (NO)
  
  > Type "n" and press ENTER


┌─────────────────────────────────────────────────────────────────┐
│ STEP 13: FINAL CONFIRMATION                                     │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────────┐
  │ * Proceed with installation? (y/N):                             │
  └─────────────────────────────────────────────────────────────────┘
  
  >>> SELECT: y (YES)
  
  > Type "y" and press ENTER
  > Wait for installation to complete...


╔══════════════════════════════════════════════════════════════════╗
║                   INSTALLATION COMPLETE!                         ║
║                                                                  ║
║  Your Pterodactyl Panel is now installed!                        ║
║                                                                  ║
║  Access your panel at:                                           ║
║  http://YOUR_SERVER_IP                                           ║                        ║
║                                                                  ║
║  Login with:                                                     ║
║  Email: [your admin email]                                       ║
║  Password: [your admin password]                                 ║
║                                                                  ║ 
║  ⚠️  IMPORTANT: Your Wings still needs to be configured!         ║
║  1. Log into the panel                                           ║
║  2. Go to Admin → Nodes → Create New                             ║
║  3. Generate the configuration file                              ║
║  4. Copy it to /etc/pterodactyl/config.yml                       ║
║  5. Run: systemctl start wings                                   ║
╚══════════════════════════════════════════════════════════════════╝


┌─────────────────────────────────────────────────────────────────┐
│              QUICK REFERENCE SHEET                              │
└─────────────────────────────────────────────────────────────────┘

  ┌──────────────┬─────────────┬──────────────────────────────┐
  │ QUESTION     │ ANSWER      │ REASON                       │
  ├──────────────┼─────────────┼──────────────────────────────┤
  │ Panel/Wings  │ 3 (Both)    │ Install everything at once   │
  │ Continue?    │ y           │ Start installation           │
  │ Auto DB?     │ y           │ Let script handle DB         │
  │ DB username  │ [ENTER]     │ Use default                  │
  │ DB password  │ [TYPE]      │ Strong password (save it)    │
  │ MySQL ext    │ n           │ No external access needed    │
  │ Admin user?  │ y           │ Create admin account         │
  │ Let's Encrypt│ n           │ n = IP only, y = domain      │
  │ Configure    │ y           │ Auto open firewall ports     │
  │ UFW?         │             │                              │
  │ Wings DB     │ y           │ Create DB user for Wings     │
  │ Wings SSL    │ n or y      │ Same as panel SSL choice     │
  └──────────────┴─────────────┴──────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│              FIREWALL PORTS TO OPEN                             │
└─────────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │  Port 80   - HTTP (Web Panel)                               │
  │  Port 443  - HTTPS (Web Panel) - if SSL enabled             │
  │  Port 8080 - Wings WebSocket (Server communication)         │
  │  Port 2022 - SFTP (File transfer for servers)               │
  └─────────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────────────┐
│              TROUBLESHOOTING COMMANDS                           │
└─────────────────────────────────────────────────────────────────┘

  # Check panel status
  systemctl status nginx
  systemctl status php8.2-fpm

  # Check wings status
  systemctl status wings

  # View panel logs
  tail -f /var/www/pterodactyl/storage/logs/laravel-*.log

  # View wings logs
  journalctl -u wings -f

  # Restart panel services
  systemctl restart nginx php8.2-fpm

  # Restart wings
  systemctl restart wings

  # Generate application key (if needed)
  php /var/www/pterodactyl/artisan key:generate --force

  # Clear cache
  php /var/www/pterodactyl/artisan config:clear
  php /var/www/pterodactyl/artisan cache:clear


┌─────────────────────────────────────────────────────────────────┐
│         POST-INSTALLATION: WINGS SETUP                          │
└─────────────────────────────────────────────────────────────────┘

  1. Login to panel: http://YOUR_SERVER_IP
  
  2. Go to: Admin → Nodes → Create New
  
  3. Fill in:
     • Name: Main Node
     • Description: (optional)
     • Location: (optional)
     • Allow Automatic Allocation: Yes
     • FQDN: YOUR_SERVER_IP or domain
     • Daemon Port: 443
     • Communicate over SSL: Yes
     • Behind Proxy: Yes
     • Public: Yes
  
  4. After creating, click on the node → Configuration
  
  5. Copy the configuration code and change port 443 in it to 8080 & add 

  6. Add allowed_origins after allowed_mounts like this

allowed_mounts: []
allowed_origins:
- https://pterodactyl.entitybtw.ru
  
  7. Save to: /etc/pterodactyl/config.yml
  
  8. Start Wings:
     systemctl start wings
     systemctl enable wings

┌─────────────────────────────────────────────────────────────────┐
│                  NGINX REVERSE PROXY EXAMPLE CFG                │
└─────────────────────────────────────────────────────────────────┘

upstream pterodactyl {
    server 100.64.0.17:80;
}

upstream pterodactyl_ws {
    server 100.64.0.17:8080;
}

server {
    listen 80;
    server_name pterodactyl.entitybtw.ru;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    # http2 on;
    server_name pterodactyl.entitybtw.ru;

    ssl_certificate /etc/letsencrypt/live/pterodactyl.entitybtw.ru/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/pterodactyl.entitybtw.ru/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    client_max_body_size 10G;

    location = /api/system {
        proxy_pass http://pterodactyl_ws;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Origin https://pterodactyl.entitybtw.ru;
        proxy_buffering off;
    }

    location /upload/ {
        proxy_pass http://pterodactyl_ws;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Origin https://pterodactyl.entitybtw.ru;
        client_max_body_size 10G;
    }

    location /download/ {
        proxy_pass http://pterodactyl_ws;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Origin https://pterodactyl.entitybtw.ru;
        proxy_buffering off;
    }

    location ~ ^/api/servers {
        proxy_pass http://pterodactyl_ws;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Origin https://pterodactyl.entitybtw.ru;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
        proxy_buffering off;
    }

    location / {
        proxy_pass http://pterodactyl;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}


┌─────────────────────────────────────────────────────────────────┐
│                  IMPORTANT NOTES                                │
└─────────────────────────────────────────────────────────────────┘

  ⚠️  SAVE ALL PASSWORDS: Panel DB, Admin user, Wings DB
  
  ⚠️  Wait for migrations to complete (may take 2-5 minutes)
  
  ⚠️  If using IP instead of domain, you'll see a security warning
     (This is normal, just proceed)
  
  ⚠️  For production, use a domain with SSL certificates
  
  ⚠️  Backup /var/www/pterodactyl/.env file after installation


╔══════════════════════════════════════════════════════════════════╗
║                  INSTALLATION SUCCESS!                           ║
║                                                                  ║
║  Your Pterodactyl Panel is now ready for use!                    ║
║                                                                  ║
╚══════════════════════════════════════════════════════════════════╝